<?php
include_once("inc/connection.php");
include_once("inc/constants.inc.php");
session_start();

if(!isset($_SESSION['login']) || empty($_SESSION['login']) || !isset($_SESSION['email']) || empty($_SESSION['email']) || !isset($_SESSION['user_role']))
	{
		header("Location: login.php?error=invalid-access");
		exit(0);
	}
elseif($_SESSION['user_role']==2)
	{
		header("Location: test.php?error=invalid-access");
		exit(0);
	}
 $result = mysql_query("SELECT * FROM question_type");
 
		?>
		
		
		
		
		<fieldset><legend><h3>Question Type List</h3></legend>
		<form name="input" action="add-update-type.php" method="get">
		<?php
        echo "<table class='table table-bordered table-striped'>
        <thead>
		<tr>
		<th></th>
		<th>Question Type ID</th>
        <th>Question Type</th>
        </tr></thead>";

        while($row = mysql_fetch_array($result))
        {
            echo "<tbody><tr>";
			echo "<td><input type='radio' name='radiobutton' value=". $row['QTypeID']. "></td>";
			echo "<td>" . $row['QTypeID'] . "</td>";
            echo "<td>" . $row['QType'] . "</td>";
            echo "</tr></tbody>";
        }
        echo "</table>";
		?>
		 <br><br>
                  <div><input class="btn btn-default menuspan" type="submit" name="add-type" value="Add">
                    <input class="btn btn-default menuspan" type="submit" name="update-type" value="Update" />
                    <input class="btn btn-default menuspan" type="submit" name="delete-type" value="Delete">
                  </div>
                 </form>

	